﻿using Topthink.Ruitu.QuestionBank.Authors;
using Topthink.Ruitu.QuestionBank.Books;
using AutoMapper;

namespace Topthink.Ruitu.QuestionBank.Web
{
    public class QuestionBankWebAutoMapperProfile : Profile
    {
        public QuestionBankWebAutoMapperProfile()
        {
            CreateMap<BookDto, CreateUpdateBookDto>();
            
            CreateMap<Pages.Authors.CreateModalModel.CreateAuthorViewModel,
                CreateAuthorDto>();
            
            CreateMap<AuthorDto, Pages.Authors.EditModalModel.EditAuthorViewModel>();
            
            CreateMap<Pages.Authors.EditModalModel.EditAuthorViewModel,
                UpdateAuthorDto>();
            
            CreateMap<Pages.Books.CreateModalModel.CreateBookViewModel, CreateUpdateBookDto>();
            
            CreateMap<BookDto, Pages.Books.EditModalModel.EditBookViewModel>();
            
            CreateMap<Pages.Books.EditModalModel.EditBookViewModel, CreateUpdateBookDto>();
        }
    }
}